package nc.ui.xinzi.kemuxiangmu;

import java.util.ArrayList;

import nc.ui.pub.locator.MyNCLocator;

public class PKManage {
	ArrayList<String> newpk = null;

	int thispkno = -1;

	public PKManage(int n) {
		try {
			newpk = MyNCLocator.getLocator().getIgz().getnewpklist(n);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public String getNewPK() {
		thispkno++;
		if (thispkno<newpk.size()) {
			return newpk.get(thispkno);
		}else {
			return getOneMorePK();
		}
		
	}
	protected String getOneMorePK() {
	try {
		String 	OneMorePK= MyNCLocator.getLocator().getIgz().getnewpklist(1).get(0);
		return OneMorePK;
	} catch (Exception e) {
		e.printStackTrace();
	}
	return null;
	}
}
